home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / disk_led.zip / DISK-LED.PAS < prev   
Pascal/Delphi Source File  |  1996-05-27  |  1KB  |  47 lines

  1. {$M 1024,0,0}
  2. {$R-,S-,I-}
  3. uses dos;
  4.  
  5. const
  6.   timerint         = $08;
  7. var
  8.   oldtimervec           : procedure;
  9.   {$f+}
  10.   drivestatus           : byte;
  11.   oldchar , oldatr      : byte;
  12.   newstatus , oldstatus : byte;
  13.  
  14. procedure newtimervec( flags , cs , ip , ax , bx , cx , dx , si , di , ds , es , bp : word ); interrupt;
  15. begin
  16.   drivestatus := mem[ $0040 : $03f ];
  17.   newstatus := drivestatus and 1;
  18.  
  19.   if ( ( newstatus > 0 ) and ( oldstatus = 0 ) ) then begin
  20.     if ( mem[ $b800 : $0000 ] <> 44 ) then begin
  21.       oldchar := mem[ $b800 : $0001 ];
  22.       oldatr := mem[ $b800 : $0000 ];
  23.     end;
  24.   end;
  25.  
  26.   if ( ( newstatus > 0 ) and ( oldstatus > 0 ) ) then begin
  27.     memw[ $b800 : $0000 ] := ( drivestatus div 128 ) * 5 + 82 + 44 * 256;
  28.   end;
  29.  
  30.   if ( ( newstatus = 0 ) and ( oldstatus > 0 ) ) then begin
  31.     mem[ $b800 : $0000 ] := oldatr;
  32.     mem[ $b800 : $0001 ] := oldchar;
  33.   end;
  34.  
  35.   oldstatus := newstatus;
  36.   inline( $9C );
  37.   oldtimervec;
  38. end;
  39.  
  40. {$f-}
  41. begin
  42.   oldstatus := mem[ $0040 : $003f ] and 1;
  43.   getintvec( timerint , @oldtimervec );
  44.   setintvec( timerint , @newtimervec );
  45.   keep( 0 );
  46. end.
  47.